package com.github.sparkzxl.demo.interfaces.controller;

import com.github.sparkzxl.core.annotation.ResponseResult;
import com.github.sparkzxl.demo.application.service.IUserService;
import com.github.sparkzxl.demo.infrastructure.entity.UserBasicInfo;
import com.github.sparkzxl.log.annotation.WebLog;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@WebLog
@ResponseResult
@Api(tags = "用户管理")
@RequestMapping("/user")
public class UserController {

    private final IUserService userService;

    public UserController(IUserService userService) {
        this.userService = userService;
    }

    @ApiOperation("用户列表")
    @GetMapping("/userList")
    public List<UserBasicInfo> userList() {
        return userService.findUserBasicInfoList();
    }
}
